//
//  oldSuspendView.m
//  laonianbang
//
//  Created by 勇拓 李 on 18/4/4.
//  Copyright © 2018年 zaiyou. All rights reserved.
//

#import "oldSuspendView.h"
#import "AppDelegate.h"

@interface oldSuspendView()
@property (weak, nonatomic) IBOutlet UILabel *label_title;
@property (weak, nonatomic) IBOutlet UIImageView *img;

@end

@implementation oldSuspendView

- (instancetype)init
{
    self = [[[NSBundle mainBundle] loadNibNamed:@"oldSuspendView"
                                          owner:self
                                        options:nil] objectAtIndex:0];
    if(self)
    {
        UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapView:)];
        
        [self addGestureRecognizer:tap];
        
//        self.layer.shadowColor = [UIColor blackColor].CGColor;
//        self.layer.shadowOffset = CGSizeMake(3, 3);
//        self.layer.shadowOpacity = 0.5;
//        self.layer.shadowRadius = 2;
    }
    
    return self;
}

- (void)addToView
{
    self.frame = CGRectMake(SCREEN_WIDTH - 76, 280, 76, 76);
    [[AppDelegate getMainWindow] addSubview:self];
}

- (void)removeView
{
    [self removeFromSuperview];
}

- (void)tapView:(id)sender
{
    [self.delegate SuspendViewTouched];
}

- (void)awakeFromNib
{
    [super awakeFromNib];
    
    self.layer.cornerRadius = 76/2;
}

- (void)setTitle:(NSString *)title
{
    _title = title;
    _label_title.text = title;
    [_img setImage:[UIImage imageNamed:title]];
}

@end
